﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BBICMS.Model.Works;
using BBICMS.Resources;

namespace BBICMS.Model.DTO
{
    public class WorkDTO
    {
        [Key]
        public int Id { get; set; }
        [Display(ResourceType = typeof(Labels), Name = "Title")]
        [Required(ErrorMessage = "请输入主题")]
        public string Title { get; set; }

        [Display(Name = "解决方案")]
        public int SolutionId { get; set; }

        [Display(Name = "客户名称", Prompt = "客户名称")]
        [Required(ErrorMessage = "请输入客户名称")]
        public string ClientName { get; set; }

        [Display(Name = "完成年份", Prompt = "完成年份")]
        [Required(ErrorMessage = "请输入排序")]
        [RegularExpression(@"^-?\d*$", ErrorMessage = "格式不正确")]
        public int FinishYear { get; set; }
        [Display(Name = "关键字", Prompt = "关键字")]
        public string KeyWords { get; set; }

        [Display(Name = "描述", Prompt = "描述")]
        public string Abstract { get; set; }

        [Display(Name = "内容", Prompt = "内容")]
        public string Body { get; set; }

        [Display(Name = "显示", Prompt = "显示")]
        public int ViewCount { get; set; }

        [Display(Name = "缩略图", Prompt = "缩略图")]
        [Required]
        public string Thumbnail { get; set; }
        [Display(Name = "大图", Prompt = "大图")]
        public string ImageUrl { get; set; }

        [Display(Name = "网址", Prompt = "网址")]
        [Url(ErrorMessage = "网址格式不正确")]
        public string Demourl { get; set; }

        [Display(Name = "推荐", Prompt = "推荐")]
        public bool Recommend { get; set; }

        [Display(Name = "激活", Prompt = "激活")]
        public bool Active { get; set; }


        public string TypeIds { get; set; }

        [Display(Name = "案例分类")]
        public string[] WorkTypesIds { get; set; }

        public virtual ICollection<WorkType> WorkTypes { get; set; }
       
    }
}
